﻿
using System.Collections.Generic;
using MiniWeb.Core.Dtos;
using MiniWeb.Core.Entities;
using MiniWeb.Dao;
using MiniWeb.Core.Entities;
using WFramework.MvcPager;

namespace MiniWeb.Task
{
    public class OrderAddressTask
    {
        private readonly OrderAddressDao _dao = new OrderAddressDao();
        public PagedList<OrderAddress> GetPagedList(string account, int pageIndex, int pageSize)
        {
            return _dao.GetPagedList(account, pageIndex, pageSize);
        }


        public List<OrderAddress> GetByAccount(string account)
        {
            return _dao.GetByAccount(account);
        }

        public OrderAddress GetById(int id)
        {
            return _dao.GetById(id);
        }

        public void SetUnDefault(string account)
        {
            _dao.SetUnDefault(account);
        }

        public void Delete(int id)
        {

            _dao.Delete(id);
        }
        public OrderAddress GetDefault(string account)
        {
            return _dao.GetDefault(account);
        }

        public bool Exists(int id)
        {

            return _dao.Exists(id);
        }

        public void Add(OrderAddress model)
        {

            _dao.Add(model);
        }
        public int AddReturn(OrderAddress model)
        {

            return (int)_dao.Add(model);
        }


        public void Update(OrderAddress model)
        {

            _dao.Update(model);
        }

        public List<OrderAddress> GetAll(int? top, string strwhere, string orderby)
        {
            return _dao.GetAll(top, strwhere, orderby);
        }



    }
}